<template>
	<view style="margin: 0 20rpx;">
		<view class="item_head">
			<text class="text_color">{{move_info.title}}</text>
			<view>
				<text class="text_color" @click="toMore(move_info.title)">查看更多</text>
				<uni-icons type="forward" class="text_color"></uni-icons>
			</view>
		</view>
		<!-- 下方的列表 -->
		<view class="nav">
			<view class="active_item" v-for="(item,index) in move_info.move_list" :key="item._id" @click="toDetail(item._id)">
				<image :src="item.img">
				</image>
				<text>{{item.movie_name}}</text>
				<text class="actor">{{item.actor.length>0?item.actor.toString(","):"未知"}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "homeItem",
		props: ['move_info'],
		data() {
			return {
				
			};
		},
		methods:{
			toMore(title){
				console.log(title);
				uni.navigateTo({
					url:`../../pages/move_list/move_list?key=${title}`
				})
			},
			toDetail(id){
				uni.navigateTo({
					url:`../../pages/detail/detail?id=${id}`
				})
			}
		}
	}
</script>

<style scoped>
	.item_head {
		display: flex;
		justify-content: space-between;
		margin: 20rpx;
	}

	.active_item {
		display: flex;
		flex-direction: column;
		align-items: center;
		flex: 1;
		width: 33.3%;
	}

	.active_item image {
		width: 200rpx;
		height: 300rpx;
		border-radius: 20rpx;
	}

	.nav {
		display: flex;
		flex-wrap: wrap;
		align-content: flex-start;
	}

	.actor {
		width: 200rpx;
		font-size: 20rpx;
		color: rgba(0, 0, 0, 0.5);
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		word-break: break-all;
		text-align: center;
	}

	.text_color {
		font-size: 18px;
		background-image: linear-gradient(135deg, #fccf31, #f55555);
		background-clip: text;
		-webkit-background-clip: text;
		color: transparent;

	}
</style>
